package com.ubing.boot.notesforjava.domel.entity;

import cn.hutool.core.util.DesensitizedUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.ubing.boot.notesforjava.annotation.Sensitive;
import lombok.Data;
import lombok.ToString;

import java.io.Serializable;
import java.lang.annotation.Annotation;
import java.lang.reflect.*;
import java.time.LocalDateTime;
import java.util.Map;

/**
 * <p>
 * 
 * </p>
 *
 * @author ubing
 * @since 2023-02-17
 */
@TableName("user_info")
@Data
@ToString
public class UserInfo implements Serializable {

    private static final long serialVersionUID = 1L;

      /**
     * 用户ID
     */
      @TableId
      private String userId;

      /**
     * 用户账号
     */
      private String userName;

      /**
     * 用户密码
     */
      private String password;

      /**
     * 性别
     */
      private Integer sex;

      /**
     * 出生日期
     */
      @JsonDeserialize(using = LocalDateTimeDeserializer.class)
      @JsonSerialize(using = LocalDateTimeSerializer.class)
      private LocalDateTime birthDay;

      /**
     * 电子邮件
     */
      private String email;

      /**
     * 电话号码
     */
      @Sensitive(DesensitizedUtil.DesensitizedType.MOBILE_PHONE)
      private String phoneNumber;

      /**
     * 用户状态
     */
      private Integer userStat;

      /**
     * 更新时间
     */
      @JsonDeserialize(using = LocalDateTimeDeserializer.class)
      @JsonSerialize(using = LocalDateTimeSerializer.class)
      private LocalDateTime updateTime;

      /**
     * 创建时间
     */
      @JsonDeserialize(using = LocalDateTimeDeserializer.class)
      @JsonSerialize(using = LocalDateTimeSerializer.class)
      private LocalDateTime createTime;

      /**
     * ip地址
     */
      private String ipAddr;
      /**
     * 用户头像
     */
      private String userAvatar;
      /***
      * token
      */
      @TableField(exist = false)
      private String token;


}
